<!--
 * @Author: 罗微
 * @Date: 2020-09-21 20:45:04
 * @LastEditors: 岸舟
 * @LastEditTime: 2020-09-23 19:37:34
 * @Description: 
-->
<template>
<div>
    <el-col :span="24" class="sector">
        <h1>处理理赔订单</h1>
        <el-form ref="form" :model="form" label-width="80px">
            <el-form-item label="审核操作">
                <el-radio-group v-model="form.status">
                    <el-radio label="8">通过审核</el-radio>
                    <el-radio label="9">拒绝申请</el-radio>
                </el-radio-group>
            </el-form-item>
            <el-col :span="12">
                <el-form-item label="审核详情">
                    <el-input type="textarea" v-model="form.reason"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="modClaim">立即提交</el-button>
                    <el-button @click="cancel">取消</el-button>
                </el-form-item>
            </el-col>
        </el-form>
    </el-col>
</div>
</template>

<script>
import api from '../../http/apis/apis';
export default {
    props: ["id"], //拿到list传过来的ID
    data() {
        return {
            form: {
                _id: this.id,
                status: '',
                reason: ''
            }
        }
    },
    methods: {
        async modClaim() {
            if (this.form.status) {
                const {
                    data
                } = await api.claimApi.modClaim(this.form);
                // console.info(data)
                if (data.status) {
                    this.$alert('审核已提交', '提交成功', {
                        confirmButtonText: '确定',
                    });
                }
            };
        },
        cancel() {
            this.$router.push({
                path: '/System/ClaimOrder/getClaims'
            });
        }
    }
}
</script>

<style lang="scss" scoped>
@import '../../assets/scss/public/sector.scss';
</style>
